package spring.atguigu.springcloud.Controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class OrderConsulController {

    @Autowired
    private RestTemplate restTemplate;

    public static final String PAYMENT_URL="http://consul-provider-payment";

    
    @RequestMapping(value = "consumer/payment/consul",method = RequestMethod.GET)
    public String PaymentInfo(){
        return restTemplate.getForObject(PAYMENT_URL+"/payment/consul", String.class);
    }
}
